<template>
    <div>
        <h2>我是首页</h2>
        <p>我是首页哈哈哈</p>
        <router-link to="/home/news">666</router-link>
        <router-link to="/home/message">xixi</router-link>
        <router-view></router-view>
    </div>
</template>

<script>
export default {
    name: 'HomeNewsPage',
    data() {
        return{
            message:"你好啊",
            path: '/home/news'
        }
    },
    activated() {
      this.$router.push(this.path)
    },
    beforeRouteLeave(to, from, next) {
        console.log('离开home');
        this.path = this.$route.path
        next()
    }
}
</script>

<style lang="scss" scoped></style>